#ifndef PIPE_H_
#define PIPE_H_

#include <unistd.h>
#include <fcntl.h>

#define	READING		0
#define	WRITING	1

class Pipe {

private:

	int descriptors[2];
	bool reading;
	bool writing;

public:
	Pipe();
	virtual ~Pipe();

	void setMode ( int mode );

	int writeToPipe ( char* data,int dataSize );
	int readFromPipe ( char* buffer,int bufferSize );

	int getReadingFD ();
	int getWritingFD ();

	void closePipe ();
};

#endif /* PIPE_H_ */
